<?php

namespace Client\View\Helper;

use Zend\Form\View\Helper\AbstractHelper;

class OrderHelper extends AbstractHelper
{
    function DateToWeek($date){
        return '周'.'一';
    }
    
    function PeriodTime($meal_type){
        if ($meal_type == 1) {
            return "上午";
        } elseif ($meal_type == 2) {
            return "中午";
        } elseif ($meal_type == 3) {
            return "下午";
        }
    }
    
    function AddressCates($cates) {
        $html_content = '';
        if($cates){
            $html_content .= '<td calss="details"  colspan="4">';
            $html_content .= '<table id="address-list-show" class="custom-table" border="0" cellpadding="0" cellspacing="0">';
            $html_content .= '<tbody>';
            foreach($cates as $v){
                $html_content .= ' <tr>';
                $html_content .= '<td colspan="2" style="text-align:left" class="edit-address" data-address-id="'.$v['id']. '">' .$v['html'].$v['title']. ' </td><td  colspan="2"><a href="javascript:editAddress( '.$v['id']. ');">修改</a></td>';
                $html_content .= '</tr>';
            }
            $html_content .= ' </tbody>';
            $html_content .= '</table>';
            $html_content .= ' </td>';
        }
        return $html_content;
    }
}